package com.itheima.collectionsdemo;

import java.util.*;

public class CollectionsDemo1 {

    public static void main(String[] args) {
        Set<String> set = new HashSet<>(Set.of("hello", "world", "java"));
        Collections.addAll(set, "java", "java");
        for (String s : set){
            System.out.println(s);
        }

        List<String> list = new ArrayList<>(List.of("hello", "world", "java"));
        Collections.addAll(list, "java", "java");
        Collections.sort(list);
        for (String s : list){
            System.out.println(s);
        }
    }
}
